-- GENERATED SPELL FOR [Westguard Cavalryman] --


function spell0_23851(pUnit, Event) --@Defensive Stance,Self--
pUnit:FullCastSpellOnTarget(7164,pUnit)
pUnit:RegisterEvent('Sorts_23851', 613, 1)
end

function spell1_23851(pUnit, Event) --@Improved Blocking,Self--
pUnit:FullCastSpellOnTarget(3639,pUnit)
pUnit:RegisterEvent('Sorts_23851', 6264, 1)
end

function spell2_23851(pUnit, Event) --@Shield Bash,n/a--
pUnit:FullCastSpellOnTarget(11972,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23851', 8261, 1)
end

function Sorts_23851(pUnit, Event)
local choix_sorts_23851 = math.random(0, 2)
if choix_sorts_23851 == 0 then
pUnit:RegisterEvent('spell0_23851', 1, 1)
end
if choix_sorts_23851 == 1 then
pUnit:RegisterEvent('spell1_23851', 1, 1)
end
if choix_sorts_23851 == 2 then
pUnit:RegisterEvent('spell2_23851', 1, 1)
end
end

function mob23851_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23851', math.random(1500, 3000), 1)
end

function mob23851_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23851_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23851_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23851, 1, 'mob23851_Action')
RegisterUnitEvent(23851, 2, 'mob23851_Leave')
RegisterUnitEvent(23851, 3, 'mob23851_Kill')
RegisterUnitEvent(23851, 4, 'mob23851_Die')
